package com.dm_solution.powerlineswitch;

import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;

public abstract class BaseActivity extends Activity {

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item)
	{
		switch(item.getItemId())
		{
			case R.id.item1:
			{ 
				return true;
			}
			case R.id.item2:
			{ 
				startActivity(new Intent(getApplicationContext(),MainActivity.class));
				return true;
			}
			case R.id.item3:
			{ 
				startActivity(new Intent(getApplicationContext(),MainActivity2.class));
				return true;
			}
			default:
				return super.onContextItemSelected(item);
		}
	}
}
